/**
 * 上海交大--鹏越惊虹
 */
package org.infosec.lc.exercises.jdk6Features;

import java.io.Console;

/**
 * 作者：林超 <br>
 * 时间：2011-12-26 下午04:38:21 <br>
 * 完整类名：org.infosec.lc.exercises.jdk6Features.Consoles <br>
 * 说明：<br>
 * <br>
 * POM.xml<br>
 * <br>
 */
public class Consoles {

	/**
	 * 说明：<br>
	 * 参数：<br>
		@param args
	 */
	public static void main(String[] args) {
		Console console  =  System.console();
        if ( console  !=   null  )  {
           String user  =   new  String( console.readLine(  " Enter User: " ,  new  Object[  0  ] ) );
           String pwd  =   new  String( console.readPassword(  " Enter Password: " ,  new  Object[  0  ] ));
           console.printf(  " User name is:%s " ,  new  Object[] {user}  );
           console.printf(  " Password is:%s " ,  new  Object[] {pwd}  );
       }   else   {
           System.out.println(  " No Console! "  );
       } 
	}

}
